package com.example.pingxue.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import java.util.Set;

@Entity
@Getter
@Setter
public class Teacher extends User {
    @Column
    private String teacherName;
    @Column
    private String school;
    @Column
    private String research;

    @OneToMany(mappedBy = "teacher",
            cascade = CascadeType.ALL,
            orphanRemoval = true,
            fetch = FetchType.LAZY)
    @JsonIgnoreProperties("teacher")
    private Set<TClass> clazz;

//    public void scoreStudent(Selection selection, Double score) {
//        selection.setScore(score);
//    }

    public Teacher() {}
    public Teacher(String teacherName, String school, String research) {
        this.teacherName = teacherName;
        this.school = school;
        this.research = research;
    }


}
